package com.example.sls.controller.field;

import com.example.sls.pojo.field.FieldMaintenance;
import com.example.sls.service.intserfaces.field.FieldMaintenanceService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 场地维护记录表(FieldMaintenance)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("field/fieldMaintenance")
public class FieldMaintenanceController {
  @Autowired
  FieldMaintenanceService fieldMaintenanceService;

  @GetMapping("queryById")
  FieldMaintenance queryById(Integer id) {
    return fieldMaintenanceService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<FieldMaintenance> queryAllByLimit(FieldMaintenance fieldMaintenance, Integer pageSize, Integer offset) {
    return fieldMaintenanceService.queryAllByLimit(fieldMaintenance, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return fieldMaintenanceService.count();
  }

  @GetMapping("insert")
  int insert(FieldMaintenance fieldMaintenance) {
    return fieldMaintenanceService.insert(fieldMaintenance);
  }

  @GetMapping("update")
  int update(FieldMaintenance fieldMaintenance) {
    return fieldMaintenanceService.update(fieldMaintenance);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return fieldMaintenanceService.deleteById(id);
  }
}

